//1. create a http module
const http = require('http');
//2.create a server
const server = http.createServer((req,res)=>{
    if(req.url==='/'){
        res.write('Hello World from Node.js');
        res.end();
    }else{
        res.write('Using some other domain');
        res.end();
    }
});
//3.listen to the port.
server.listen('3000');//http://localhost:3000-->if;http://localhost:3000/abc-->else;
